#ifndef FSA_H
#define FSA_H

#include <QObject>
#include <QFileSystemWatcher>
#include <QDir>
#include <QTimer>
#include <QMutex>

class Fsa : public QObject
{
    Q_OBJECT
    Q_PROPERTY(QString ifld READ IFolder WRITE setIFolder)
    Q_PROPERTY(QString ofld READ OFolder WRITE setOFolder)

public:
    explicit Fsa(QObject *parent = 0);

    void setIFolder(QString);
    QString IFolder();

    void setOFolder(QString);
    QString OFolder();

    enum savetypes { local, remote };
    void setSaveType(savetypes);
    savetypes SaveType();


signals:
    void IFolderMising();
    void OFolderMising();

public slots:


private:
    QString ifldn, ofldn;
    savetypes savetype;

    QFileSystemWatcher fsw;
    QStringList fls;
    uint count;
    QDir ifld, ofld;
    void handleFile(QString);
    QStringList cpfls;
    QMutex mtx;


private slots:
    void findNewFiles(QString);
    void moveFile();


};

#endif // FSA_H
